﻿using BackTask.DashBoard.Extensions;
using BackTask.DashBoard.Lisenters;
using BackTask.Model;

namespace BackTask.DashBoard.Configurations
{
    public class DashboardSettingConfiguration : BackTaskSettingConfiguration
    {
        protected BaseTaskJobBuilder taskJobBuilder;
        public DashboardSettingConfiguration() { }
        public DashboardSettingConfiguration(BaseTaskJobBuilder taskJobBuilder)
        {
            JobManager.CreateInstance().UseJobBuilder(taskJobBuilder);
            this.taskJobBuilder = taskJobBuilder;
        }

        public override void Run()
        {
            RunTime.RunApp();
        }

        public override DashboardSettingConfiguration UseTaskJobBuilder(BaseTaskJobBuilder builder)
        {
            this.taskJobBuilder = builder;
            JobManager.CreateInstance().UseJobBuilder(builder);

            return this;
        }
    }
}
